﻿/*
 * Cast和OfType操作符用于处理以前版本的集合
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace DemoForLinq.Chapter1
{
    class Demo1_7_UseCastOperator
    {
        static void Main(string[] args)
        {
            ArrayList list=new ArrayList();
            list.Add("Adams");
            list.Add("Arthur");
            list.Add("Buchanan");
            IEnumerable<string> names = list.Cast<string>().Where(n => n.Length < 7);
            foreach (var name in names)
            {
                Console.WriteLine(name);
            }
        }
    }
}
